﻿using Servicios.Business.Interfaces;
using Servicios.Data.DataBases.Biblioteca;

namespace Servicios.Business.Entidades
{
    /// <summary>
    /// Entidades abstracta business del sistema
    /// </summary>
    /// <typeparam name="T">Data Transfer Object DTO</typeparam>
    public abstract class ObjectBusiness<T> : IObjectBusiness<T> where T : global::System.Data.Objects.DataClasses.EntityObject, new()
    {
        private T entity;
        /// <summary>
        /// Data Transfer Object DTO
        /// </summary>
        public T Entity
        {
            get
            {
                if (entity == null)
                    entity = new T();
                return entity;
            }
            set
            {
                entity = value;
            }
        }
    }
}
